package tq.com.tqim.socket.message;

import org.json.JSONException;
import org.json.JSONObject;

import java.nio.ByteBuffer;

public class TQIMSValidMsg extends TQIMSMessage {
    private String token;
    public TQIMSValidMsg(String token){
        this.token = token;
    }

    @Override
    public ByteBuffer getBuffer() {
        JSONObject object = new JSONObject();
        try{
            object.putOpt("msg_id", 500);
            object.putOpt("token", token);
        }catch (JSONException e){
            e.printStackTrace();
        }

        this.setBody(object.toString());
        return super.getBuffer();
    }
}
